package cn.lyh.FoodSystem.Controller;

import cn.lyh.FoodSystem.Dto.PageInfo;
import cn.lyh.FoodSystem.Dto.Result;
import cn.lyh.FoodSystem.Entity.Video;
import cn.lyh.FoodSystem.Service.VideoService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping("/video")
public class VideoController {

   private final VideoService videoService;

    public VideoController(VideoService videoService) {
        this.videoService = videoService;
    }

    /**
     * 添加视频视频
     */
    @PostMapping("/addVideo")
    public Result addVideo(@RequestBody Video video){
       return videoService.addVideo(video);
   }

    /**
     * 查询学习视频
     */
    @PostMapping("/queryVideo")
    public Result queryVideo(@RequestBody PageInfo pageInfo){
        return videoService.queryVideo(pageInfo);
    }

}
